﻿/**********************************弘石项目*******************************************
* 功能描述:项目管理
* 作者:石锦涛
* 时间:2021-12-7
* 
**********************************弘石项目*******************************************/
using Dapper;
using HongStone.Domain.OperationsManagement;
using HongStone.Domain.SystemSetupModel.FrequentlyUsedDataModel;
using HongStone.Domain.SystemSetupModel.InstitutionSettingModel;
using HongStone.Dto;
using HongStone.Ince.IClient;
using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HongStone.Repository
{
    public class OperationDal: ICOperation
    {
        private readonly HongStoneContext _hongStoneContext;

        private readonly IConfiguration _configuration;
        public OperationDal(HongStoneContext hongStoneContext, IConfiguration configuration)
        {
            _hongStoneContext = hongStoneContext;
            _configuration = configuration;
        }

        /// <summary>
        /// 字典下拉框数据
        /// </summary>
        /// <returns></returns>
        public ResultData Showdictionaries()
        {
            try
            {
                var query = _hongStoneContext.dictionariesTables.AsQueryable();
                return new ResultData() { Code = 1, Data = query };
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        ///  合同关联
        /// </summary>
        /// <returns></returns>
        public ResultData ShowContract(out int totalCount, string cname,int pageindex=1,int pagesize=5)
        {
            try
            {
                var list = from a in _hongStoneContext.thecontracts
                           select new XiaLaContractDto
                           {
                               ContractId = a.ContractId,
                               ContractName = a.ContractName,
                               Contractsigningdate = a.Contractsigningdate,
                           };
                if(!string.IsNullOrEmpty(cname))
                {
                    list = list.Where(p => p.ContractName.Contains(cname));
                }
                totalCount = list.Count();
                var query= list.OrderBy(p => p.ContractId).Skip((pageindex - 1) * pagesize).Take(pagesize).ToList();
                return new ResultData() { Code = 1, TotalCount = totalCount, Data = query };
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 承接部门
        /// </summary>
        /// <returns></returns>
        public ResultData ShowCJSection(out int totalCount, int pageindex = 1, int pagesize = 5)
        {
            try
            {
                var list = from a in _hongStoneContext.departments
                           select new XiaLaContractDto
                           {
                               DeptIdy = a.DeptId,
                               DeptName = a.DeptName,
                           };
                totalCount = list.Count();
                var query = list.OrderBy(p => p.DeptIdy).Skip((pageindex - 1) * pagesize).Take(pagesize).ToList();
                return new ResultData() { Code = 1, TotalCount = totalCount, Data = query };
            }
            catch (Exception)
            {

                throw;
            }
        }


        /// <summary>
        /// 甲方负责人
        /// </summary>
        /// <returns></returns>
        public ResultData ShowFirstParty(out int totalCount,string xname,string bumen,string phone, int pageindex = 1, int pagesize = 5)
        {
            try
            {
                var list = from a in _hongStoneContext.responsiblePersons
                           select new XiaLaContractDto
                           {
                               SerialNumber = a.SerialNumber,
                               PersonName = a.PersonName,
                               PersonDepartment = a.PersonDepartment,
                               PersonPhone = a.PersonPhone,
                           };
                //姓名
                if (!string.IsNullOrEmpty(xname))
                {
                    list = list.Where(p => p.PersonName.Contains(xname));
                }
                //部门
                if (!string.IsNullOrEmpty(bumen))
                {
                    list = list.Where(p => p.PersonDepartment.Contains(bumen));
                }
                //手机号
                if(!string.IsNullOrEmpty(phone))
                {
                    list = list.Where(p => p.PersonPhone==phone);
                }
                totalCount = list.Count();
                var query = list.OrderBy(p => p.SerialNumber).Skip((pageindex - 1) * pagesize).Take(pagesize).ToList();
                return new ResultData() { Code = 1, TotalCount = totalCount, Data = query };
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 执行设总
        /// </summary>
        /// <returns></returns>
        public ResultData ShowSZExecute(out int totalCount, string zname, int bumen, string phone, int pageindex = 1, int pagesize = 5)
        {
            try
            {
                var list = from a in _hongStoneContext.staffs
                           select new XiaLaContractDto
                           {
                               StaffId = a.StaffId,
                               StaffName = a.StaffName,
                               DeptId = a.DeptId,
                               Phone = a.Phone,
                           };
                //姓名
                if (!string.IsNullOrEmpty(zname))
                {
                    list = list.Where(p => p.StaffName.Contains(zname));
                }
                //部门
                if (bumen>0)
                {
                    list = list.Where(p => p.DeptId==bumen);
                }
                //手机号
                if (!string.IsNullOrEmpty(phone))
                {
                    list = list.Where(p => p.Phone == phone);
                }
                totalCount = list.Count();
                var query = list.OrderBy(p => p.StaffId).Skip((pageindex - 1) * pagesize).Take(pagesize).ToList();
                return new ResultData() { Code = 1, TotalCount = totalCount, Data = query };
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 立项结构样式
        /// </summary>
        /// <returns></returns>
        public List<StructureXMDto> ShowStructure()
        {
            try
            {
                return getStructure(_hongStoneContext.architeCtures.ToList());
            }
            catch (Exception)
            {

                throw;
            }
        }

        public List<StructureXMDto> getStructure(List<ArchiteCture> ctures,int Aid=0)
        {
            return ctures.Where(p => p.Aid == Aid).Select(p => new StructureXMDto
            {
                ArchiteCtureId = p.ArchiteCtureId,
                Aname = p.Aname,
                Aid = p.Aid,
                Cllscht = getStructure(ctures, p.ArchiteCtureId)
            }).ToList();
        }

        /// <summary>
        /// 建筑分类
        /// </summary>
        /// <returns></returns>
        public List<ArchitectureXMDto> ShowArchitecture()
        {
            try
            {
                return getArchitecture(_hongStoneContext.buildings.ToList());
            }
            catch (Exception)
            {

                throw;
            }
        }

        public List<ArchitectureXMDto> getArchitecture(List<Building> building, int Bid = 0)
        {
            return building.Where(p => p.Bid == Bid).Select(p => new ArchitectureXMDto
            {
                BuildingId = p.BuildingId,
                Bname = p.Bname,
                Bid = p.Bid,
                JianZhuXL = getArchitecture(building, p.BuildingId)
            }).ToList();
        }
        /// <summary>
        /// 添加项目立项
        /// </summary>
        /// <param name="project"></param>
        /// <returns></returns>
        public int AddProjectLX(Project project)
        {
            try
            {
                 _hongStoneContext.projects.Add(project);
                return _hongStoneContext.SaveChanges();
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 显示项目信息
        /// </summary>
        /// <param name="totalCount"></param>
        /// <param name="bumen"></param>
        /// <param name="xmName"></param>
        /// <param name="jsClass"></param>
        /// <param name="jsgm"></param>
        /// <param name="jsgms"></param>
        /// <param name="jsdanwei"></param>
        /// <param name="jgxs"></param>
        /// <param name="jzflei"></param>
        /// <param name="zxsez"></param>
        /// <param name="jiafz"></param>
        /// <param name="hte"></param>
        /// <param name="htes"></param>
        /// <param name="didian"></param>
        /// <param name="xinzhi"></param>
        /// <param name="laiyuan"></param>
        /// <param name="begtime"></param>
        /// <param name="begtimes"></param>
        /// <param name="endtime"></param>
        /// <param name="endtimes"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public ResultData ShowProject(out int totalCount,int? bumen,string xmName,int? jsClass,decimal? jsgm, decimal? jsgms, string jsdanwei,string jgxs,string jzflei,string zxsez,string jiafz,decimal? hte, decimal? htes, string didian,int? xinzhi,int? laiyuan,DateTime? begtime, DateTime? begtimes, DateTime? endtime, DateTime? endtimes, int pageindex=1,int pagesize=10)
        {
            try
            {
                var query = from a in _hongStoneContext.projects
                            select new ShowProjectListDto
                            {
                                ProjectId = a.ProjectId,
                                ProjectName = a.ProjectName,
                                SuperLevel = a.SuperLevel,
                                Devel = a.Devel,
                                Consite = a.Consite,
                                Scale = a.Scale,
                                Category = a.Category,
                                ArchiteCtureId = a.ArchiteCtureId,
                                BuildingId = a.BuildingId,
                                DesignId = a.DesignId,
                                SourceId = a.SourceId,
                                ConMoney = a.ConMoney,
                                NatureId = a.NatureId,
                                SerialNumber = a.SerialNumber,
                                JiaPhone = a.JiaPhone,
                                Total = a.Total,
                                TotalPhone = a.TotalPhone,
                                BeginTime = a.BeginTime,
                                CompletionTime = a.CompletionTime,
                                Participate = a.Participate,
                                Overview = a.Overview,
                                Note = a.Note,
                                ProjectImg = a.ProjectImg,
                                contractId = a.contractId,
                                EnteringId=a.EnteringId,
                                EnteringTime=a.EnteringTime,
                                DeptId=a.DeptId,
                                StaId = a.StaId,
                                ProId = a.ProId,
                            };
                //部门
                if(bumen>0)
                {
                    query = query.Where(p => p.DeptId == bumen);
                }
                //名称
                if(!string.IsNullOrEmpty(xmName))
                {
                    query = query.Where(p => p.ProjectName.Contains(xmName));
                }
                //建设类别
                if (jsClass > 0)
                {
                    query = query.Where(p => p.Category == jsClass);
                }
                //规模
                if (jsgm > 0&&jsgms>0)
                {
                    query = query.Where(p => p.Scale >jsgm&&p.Scale<jsgms);
                }
                //建设单位
                if(!string.IsNullOrEmpty(jsdanwei))
                {
                    query = query.Where(p => p.Devel.Contains(jsdanwei));
                }
                //结构形式
                if (!string.IsNullOrEmpty(jgxs))
                {
                    query = query.Where(p => p.ArchiteCtureId.Contains(jgxs));
                }
                //建筑分类
                if (!string.IsNullOrEmpty(jzflei))
                {
                    query = query.Where(p => p.BuildingId.Contains(jzflei));
                }
                //执行设总
                if(!string.IsNullOrEmpty(zxsez))
                {
                    query = query.Where(p => p.Total.Contains(zxsez));
                }
                //甲方负责人
                if (!string.IsNullOrEmpty(jiafz))
                {
                    query = query.Where(p => p.SerialNumber.Contains(jiafz));
                }
                //合同额
                if (hte > 0 && htes > 0)
                {
                    query = query.Where(p => p.ConMoney > hte && p.ConMoney < htes);
                }
                //建设地点
                if (!string.IsNullOrEmpty(didian))
                {
                    query = query.Where(p => p.Consite.Contains(didian));
                }
                //行业性质
                if (xinzhi > 0)
                {
                    query = query.Where(p => p.NatureId == xinzhi);
                }
                //工程来源
                if(laiyuan>0)
                {
                    query = query.Where(p => p.SourceId == laiyuan);
                }
                //项目开始日期
                if (begtime != null && begtimes != null)
                {
                    query = query.Where(p => p.BeginTime > begtime && p.BeginTime < begtimes);
                }
                //项目结束日期
                if (endtime != null && endtimes != null)
                {
                    query = query.Where(p => p.CompletionTime > endtime && p.CompletionTime < endtimes);
                }


                totalCount = query.Count();
                var list= query.OrderBy(p => p.ProjectId).Skip((pageindex - 1) * pagesize).Take(pagesize).ToList();

                return new ResultData { Code = 1, TotalCount = totalCount, Data = list };
            }
            catch (Exception)
            {

                throw;
            }
        }

        //public List<ShowProjectListDto> xianshi()
        //{
        //    try
        //    {
        //        foreach(_)
        //    }
        //    catch (Exception)
        //    {

        //        throw;
        //    }
        //}


        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="pid"></param>
        /// <returns></returns>
        public int DeletProject (string pid)
        {
            try
            {
                var query = pid.Split(',');
                foreach (var item in query)
                {
                    var id = Convert.ToInt32(item);
                    var list = _hongStoneContext.projects.Find(id);
                    if(list!=null)
                    {
                        _hongStoneContext.Remove(list);
                    }
                }
                return _hongStoneContext.SaveChanges();
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 查看详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ResultData BianJi(int id)
        {
            try
            {
                var list = _hongStoneContext.projects.FirstOrDefault(p => p.ProjectId == id);
                return new ResultData { Code = 1,Data = list }; 
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 详情导出
        /// </summary>
        /// <param name="idc"></param>
        /// <returns></returns>
        public ResultData DaochuXQ(int idc)
        {
            try
            {
                var list = _hongStoneContext.projects.Where(p => p.ProjectId == idc).ToList();
                return new ResultData { Code = 1, Data = list };

            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 项目信息修改
        /// </summary>
        /// <param name="project"></param>
        /// <returns></returns>
        public int ProjeUpdate(Project project)
        {
            try
            {
                _hongStoneContext.Entry(project).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
                return _hongStoneContext.SaveChanges();
            }
            catch (Exception)
            {

                throw;
            }

        }

  

        /// <summary>
        /// 显示项目关联合同
        /// </summary>
        /// <param name="totalCount"></param>
        /// <param name="bumen"></param>
        /// <param name="xmName"></param>
        /// <param name="endtime"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public ResultData ShowContractLinkage(out int totalCount, int? bumen, string xmName, DateTime? rtime,DateTime? endtime, int pageindex = 1, int pagesize = 10)
        {
            try
            {
                var query = from a in _hongStoneContext.projects where a.contractId==0
                            select new ShowProjectListDto
                            {
                                ProjectId = a.ProjectId,
                                ProjectName = a.ProjectName,
                                SuperLevel = a.SuperLevel,
                                Devel = a.Devel,
                                Consite = a.Consite,
                                Scale = a.Scale,
                                Category = a.Category,
                                ArchiteCtureId = a.ArchiteCtureId,
                                BuildingId = a.BuildingId,
                                DesignId = a.DesignId,
                                SourceId = a.SourceId,
                                ConMoney = a.ConMoney,
                                NatureId = a.NatureId,
                                SerialNumber = a.SerialNumber,
                                JiaPhone = a.JiaPhone,
                                Total = a.Total,
                                TotalPhone = a.TotalPhone,
                                BeginTime = a.BeginTime,
                                CompletionTime = a.CompletionTime,
                                Participate = a.Participate,
                                Overview = a.Overview,
                                Note = a.Note,
                                ProjectImg = a.ProjectImg,
                                contractId = a.contractId,
                                EnteringId = a.EnteringId,
                                EnteringTime = a.EnteringTime,
                                DeptId = a.DeptId,
                                StaId = a.StaId,
                                ProId = a.ProId,
                            };
                //部门
                if (bumen > 0)
                {
                    query = query.Where(p => p.DeptId == bumen);
                }
                //名称
                if (!string.IsNullOrEmpty(xmName))
                {
                    query = query.Where(p => p.ProjectName.Contains(xmName));
                }
                //项录入日期
                if (rtime != null)
                {
                    query = query.Where(p => p.EnteringTime == rtime);
                }
                //项目结束日期
                if (endtime != null )
                {
                    query = query.Where(p => p.CompletionTime == endtime );
                }


                totalCount = query.Count();
                var list = query.OrderBy(p => p.ProjectId).Skip((pageindex - 1) * pagesize).Take(pagesize).ToList();

                return new ResultData { Code = 1, TotalCount = totalCount, Data = list };
            }
            catch (Exception)
            {

                throw;
            }
        }


        /// <summary>
        /// 部门
        /// </summary>
        /// <returns></returns>
        public List<Department> Showbumen()
        {
            try
            {
                
                var list = _hongStoneContext.departments.ToList();
                return list;
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 部门 项目统计
        /// </summary>
        /// <returns></returns>
        public List<ProjectStatisticsDto> ShowStatistics(int bu)
        {
            try
            {
                using (var conn = new SqlConnection(_configuration.GetConnectionString("MSSQL")))
                {
                    var query = $" select a.DeptId as Id,b.DictionariesName as bumen,(case c.DictionariesName when '房地产' then COUNT(a.DeptId) else 0 end) as 'dichan' , (case c.DictionariesName when '市政' then COUNT(a.DeptId) else 0 end) as 'shizheng' ,(case c.DictionariesName when '医院' then COUNT(a.DeptId) else 0 end) as 'yiyuan' ,(case c.DictionariesName when '电力' then COUNT(a.DeptId) else 0 end) as 'dianli'from Project a  join DictionariesTable b on a.DeptId = b.DictionariesId join DictionariesTable c on a.NatureId = c.DictionariesId ";
            
                    if(bu > 0)
                    {
                        query += $"  where  a.DeptId='{bu}'";
                    }
                    var list = conn.Query<ProjectStatisticsDto>(query+ "  group by a.DeptId,b.DictionariesName,c.DictionariesName").ToList();
                    return list; 
                }
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 项目 季度 统计
        /// </summary>
        /// <param name="bu"></param>
        /// <returns></returns>
        public List<ProjectStatisticsDto> ShowQuarter(int bu)
        {
            try
            {
                using (var conn = new SqlConnection(_configuration.GetConnectionString("MSSQL")))
                {
                    var query = $"select * from (select count(DeptId) as DeptId,DictionariesName as bumenji,case when EnteringTime>= '2021-1-1' and EnteringTime<= '2021-3-31' then 'diYiJi'when EnteringTime>= '2021-4-1' and EnteringTime<= '2021-6-30' then 'diErJi'when EnteringTime>= '2021-7-1' and EnteringTime<= '2021-9-30' then 'diYSani'when EnteringTime>= '2021-10-01' and EnteringTime<= '2021-12-31' then 'diSiJi'else '查询不到' end as 季度 from Project a join DictionariesTable b on a.DeptId = b.DictionariesId where 1=1 ";
                    if (bu > 0)
                    {
                        query += $"  and DeptId='{bu}'";
                    }
                    var list = conn.Query<ProjectStatisticsDto>(query + " group by DictionariesName,EnteringTime,case when EnteringTime >= '2021-1-1' and EnteringTime <= '2021-3-31' then 'diYiJi' when EnteringTime >= '2021-4-1' and EnteringTime <= '2021-6-30' then 'diErJi' when EnteringTime >= '2021-7-1' and EnteringTime <= '2021-9-30' then 'diSanJi' when EnteringTime >= '2021-10-01' and EnteringTime <= '2021-12-31' then 'diSiJi' else '查询不到' end) T pivot(count(DeptId) for 季度  in (diYiJi, diErJi, diSanJi, diSiJi)) pvt").ToList();
                    return list;
                }
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 项目 月度 统计
        /// </summary>
        /// <param name="bu"></param>
        /// <returns></returns>
        public List<ProjectStatisticsDto> Showmonthly(int bu)
        {
            try
            {
                using (var conn = new SqlConnection(_configuration.GetConnectionString("MSSQL")))
                {
                    var query = $"select * from (select count(DeptId) as DeptId,DictionariesName as bumenyue,case when EnteringTime>= '2021-1-1' and EnteringTime<= '2021-1-31' then 'diYiyue' when EnteringTime>= '2021-2-1' and EnteringTime<= '2021-2-28' then 'diEryue'when EnteringTime>= '2021-3-1' and EnteringTime<= '2021-3-31' then 'diYSanyue' when EnteringTime>= '2021-4-01' and EnteringTime<= '2021-4-30' then 'diSiyue' when EnteringTime>= '2021-5-1' and EnteringTime<= '2021-5-31' then 'diWuyue' when EnteringTime>= '2021-6-1' and EnteringTime<= '2021-6-30' then 'diLuiyue' when EnteringTime>= '2021-7-1' and EnteringTime<= '2021-7-31' then 'diQiyue' when EnteringTime>= '2021-8-01' and EnteringTime<= '2021-8-31' then 'diBayue' when EnteringTime>= '2021-9-1' and EnteringTime<= '2021-3-30' then 'dijiuyue' when EnteringTime>= '2021-10-1' and EnteringTime<= '2021-10-31' then 'diShiyue' when EnteringTime>= '2021-11-1' and EnteringTime<= '2021-11-30' then 'diShiyiyue' when EnteringTime>= '2021-12-01' and EnteringTime<= '2021-12-31' then 'diShiEryue' else '查询不到' end as 季度 from Project a join DictionariesTable b on a.DeptId = b.DictionariesId where 1=1 ";
                    if (bu > 0)
                    {
                        query += $"  and DeptId='{bu}'";
                    }
                    var list = conn.Query<ProjectStatisticsDto>(query + " group by DictionariesName,EnteringTime,case  when EnteringTime >= '2021-1-1' and EnteringTime <= '2021-1-31' then 'diYiyue' when EnteringTime >= '2021-2-1' and EnteringTime <= '2021-2-28' then 'diEryue' when EnteringTime >= '2021-3-1' and EnteringTime <= '2021-3-31' then 'diYSanyue' when EnteringTime >= '2021-4-01' and EnteringTime <= '2021-4-30' then 'diSiyue' when EnteringTime >= '2021-5-1' and EnteringTime <= '2021-5-31' then 'diWuyue' when EnteringTime >= '2021-6-1' and EnteringTime <= '2021-6-30' then 'diLuiyue' when EnteringTime >= '2021-7-1' and EnteringTime <= '2021-7-31' then 'diQiyue' when EnteringTime >= '2021-8-01' and EnteringTime <= '2021-8-31' then 'diBayue' when EnteringTime >= '2021-9-1' and EnteringTime <= '2021-3-30' then 'dijiuyue' when EnteringTime >= '2021-10-1' and EnteringTime <= '2021-10-31' then 'diShiyue' when EnteringTime >= '2021-11-1' and EnteringTime <= '2021-11-30' then 'diShiyiyue' when EnteringTime >= '2021-12-01' and EnteringTime <= '2021-12-31' then 'diShiEryue' else '查询不到' end) T pivot(count(DeptId) for 季度  in (diYiyue, diEryue, diYSanyue, diSiyue, diWuyue, diLuiyue, diQiyue, diBayue, dijiuyue, diShiyue, diShiyiyue, diShiEryue)) pvt").ToList();
                    return list;
                }
            }
            catch (Exception)
            {

                throw;
            }
        }



        /// <summary>
        /// 项目进度统计
        /// </summary>
        /// <param name="totalCount"></param>
        /// <param name="bumen"></param>
        /// <param name="xmName"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public ResultData ShowSchedule(out int totalCount, int? bumen, string xmName, int pageindex = 1, int pagesize = 10)
        {
            try
            {
                var query = from a in _hongStoneContext.projects
                            select new ShowJinDuDto
                            {
                                ProjectId = a.ProjectId,
                                ProjectName = a.ProjectName,
                                Total = a.Total,
                                BeginTime = a.BeginTime,
                                CompletionTime = a.CompletionTime,
                                DeptId = a.DeptId,
                                StaId = a.StaId,
                                ProId = a.ProId,
                            };
                //部门
                if (bumen > 0)
                {
                    query = query.Where(p => p.DeptId == bumen);
                }
                //名称
                if (!string.IsNullOrEmpty(xmName))
                {
                    query = query.Where(p => p.ProjectName.Contains(xmName));
                }


                totalCount = query.Count();
                var list = query.OrderBy(p => p.ProjectId).Skip((pageindex - 1) * pagesize).Take(pagesize).ToList();

                return new ResultData { Code = 1, TotalCount = totalCount, Data = list };
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 人员展示
        /// </summary>
        /// <returns></returns>
        public List<Staff> ShowMember()
        {
            try
            {
                return _hongStoneContext.staffs.ToList();
            }
            catch (Exception)
            {

                throw;
            }
        }



    }
}
